package cn.jhc.dao.impl;

import java.util.List;

import org.hibernate.Session;

import cn.jhc.bean.Course;
import cn.jhc.dao.CourseDao;
import cn.jhc.util.HibernateUtil;

public class CourseDaoImpl implements CourseDao {

	@Override
	public void save(Object o) {
		if (o instanceof Course) {
			Session session = HibernateUtil.getSession();
			session.beginTransaction();
			session.save(o);
			session.getTransaction().commit();
		}
	}

	@Override
	public void update(Object o) {
		if (o instanceof Course) {
			Session session = HibernateUtil.getSession();
			session.beginTransaction();
			session.update(o);
			session.getTransaction().commit();
		}
	}

	@Override
	public void delete(Object o) {
		if (o instanceof Course) {
			Session session = HibernateUtil.getSession();
			session.beginTransaction();
			session.delete(o);
			session.getTransaction().commit();
		}
	}

	@Override
	public Object get(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List list() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List list(int start, int count) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getCount() {
		// TODO Auto-generated method stub
		return 0;
	}

}
